package Day08_20;

public class Thread1 extends Thread{
    private Account act;
    private int money;

    public Thread1(Account act, int money) {
        this.act = act;
        this.money = money;
    }
    public Thread1() {
    }

    @Override
    public void run() {
        synchronized (act) {
            this.act.withdrew(this.money);
            System.out.println(Thread.currentThread().getName() + "取款：" + this.money + "还剩存款：" + this.act.getMoney());
        }
    }
}
